<?php
$tblProIt = new Zendvn_Models_ProItem(); 
$newPro = $tblProIt->listItem($view->arrParam,array('task'=>'public-new-products'));

$lang = $view->arrParam['lang'];
if(empty($lang)){
    $lang = 'vi';
}else{
    $lang = $view->arrParam['lang'];
}

if(!empty($newPro)){
?>


<div class="content">
    <div class="group-2 width-100">
        <div class="group2-title width-90 float-left"><p>sản phẩm mới</p></div>
        <div class="group2-btn width-10 float-right">
            <a href="#"><span class="btn-left"></span></a>
            <a href="#"><span class="btn-right"></span></a>
        </div>
    </div>

    <div class="group-3 width-100">
        <?php 
        foreach ($newPro as $pro){ 
            $realLink	= FILES_PATH . '/productS/images450x450/' . $pro['picture'];
            if(file_exists($realLink)){
                $linkImg	= FILES_URL . '/productS/images450x450/' . $pro['picture'];
            }
            else{
                $linkImg	= FILES_URL . '/productS/images450x450/no-image.jpg';
            }
            $picPro 	= '<img title="'. $pro['title'] .'" src="'. $linkImg .'" width="235" height="190" alt="'.$pro['title'].'" />';
            $namePro    = $pro['name'];
            $priPro     = $pro['price'];
            
            
            $urlOptions = array('module'=>'products',
                    			'controller'=>'index',
			                    'action'=>'detail',
			                    'nname'=>$pro['alias'],
			                    'cid'=> $pro['cat_id'],
			                    'id'=>$pro['id'],
			                    'lang'=>$lang);
            $linkDetail = $this->view->url($urlOptions,'product-detail');
            
        ?>
        <div class="box-cnt width-24 col-1">
            <div class="box2">
                <div class="sp-img">
                    <?php echo $picPro; ?>
                    <div class="price">
                        <p class="price01"><?php echo $priPro; ?> VND</p>
                        <p class="price02">Thêm vào giỏ hàng</p>
                    </div>
                </div>

                <a href="#"><h2><?php echo $namePro; ?></h2></a>
                <div class="box2-link"><a href="<?php echo $linkDetail; ?>">Đặt hàng</a></div>
            </div>
        </div>
        <?php } ?>
    </div>
</div>
<?php } ?>